package com.authority.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.authority.entry.AuthMenuDO;
import com.authority.query.AuthMenuQuery;

public interface AuthMenuDAO {
	List<AuthMenuDO> queryAuthMenu(AuthMenuQuery query);
	
	AuthMenuDO queryAuthMenuById(Long id);
	
	Long insertAuthMenu(AuthMenuDO db);

	int updateAuthMenu(AuthMenuDO db);
	
	int updateBySelective(AuthMenuDO db);

	int deleteAuthMenuByIds(@Param("ids")String ids);
	
	/**
	 * 根据系统id查菜单
	 * @return
	 */
	List<AuthMenuDO> queryAuthMenuBySysId(Long sysId);
	
	/**
	 * 根据父节点查询 
	 * @param parentId
	 * @return
	 */
	List<AuthMenuDO> queryAuthMenuByParentId(Long parentId);
	
	/**
	 * 根据id查name
	 * @param id
	 * @return
	 */
	String queryNameById(Long id);
	
	/**
	 * 根据code和syId检查唯一性
	 * @param code
	 * @param sysId
	 * @return
	 */
	Long queryAuthMenuByCodeAndSysId(@Param("code")String code,@Param("sysId")Long sysId);

	/**
	 * 根据id删除
	 * @return
	 */
	int deleteAuthMenu(Long id);
	
	/**
	 * 根据系统id删除
	 * @param sysId
	 * @return
	 */
	int deleteAuthMenuBySysId(Long sysId);
	
	/**
	 * 更新父id
	 * @param parentId
	 * @return
	 */
	int batchUpdateParentId(@Param("ids")String ids,@Param("parentId")Long parentId);
}
